package com.cms.manage.service.impl;

import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cms.manage.common.ConmonConfig;
import com.cms.manage.model.HomePagePhone;
import com.cms.manage.service.HelloService;

/**
 * Created by sgy on 2017/4/7.
 */
@Service
public class HelloServiceImpl extends BaseService<HomePagePhone> implements HelloService {


   // @Autowired
   // private MoodMapper moodMapper;
	@Override
	@Transactional(rollbackFor=Exception.class)  
	public void getSeach() {
	
		
		Map<String, Object> result = ConmonConfig.getResultMap();	
		StringBuffer message = new StringBuffer(); 
		
		
		
		result.put("message", message.toString());			

		
	/*	删除
	 * Users  users = new Users();
		users.setUserId(10009);
		users.setUserName("lucerd");
		usersMapper.delete(users);
		System.out.println(users.getUserId()+"userid+++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
		System.out.println(users.getUserName()+"username+++++++++++++++++++++++++++++++++++++++++++++++++++++");
		System.out.println(users.getUserSex()+"usersex+++++++++++++++++++++++++++++++++++++++++++++++++++++++");*/
/*	     分页	
 * Example example = new Example(Mood.class);
		example.setOrderByClause("mood_id desc");
		Criteria criteria=example.createCriteria();
		 Map<String,Object> param = new HashMap<>();
		 param.put("userId", 5878);
		 criteria.andGreaterThan("moodId", 2581);
		 criteria.andLike("userName", "lucas");
		 criteria.andEqualTo(param);
		 PageHelper.startPage(1, 4);
	    List<Mood> rs =moodMapper.selectByExample(example);
	    System.out.println(rs);
	    System.out.println(rs.size());
	    System.out.println(rs.get(0).getMoodId());*/
/*	   插入	
 * Mood mood = new Mood();
		mood.setAddTime(new Date());
		mood.setComments(1);
		mood.setMood("11");
		mood.setUserIco("ceshi");
		mood.setUserId(100010);
		mood.setUserName("ceshi");
		moodMapper.insertSelective(mood);
       //更新
		  Users usr =new Users();
		  usr.setUserId(10000);
		  usr.setUserName("ceshi121212121");
		  usersMapper.updateByPrimaryKeySelective(usr);
		//  List<Users>  a = usersMapper.select(usr);
		//  System.out.println(a.size());
		 // System.out.println(num2);
		 /* System.out.println("121212");
*/		  
	}
   
    
  
}